/*
* Copyrigth 2008 Company All rigths reserved
* File Name: TS_Preview_Result_Entity.cs
* Created By:    Wenbin.Xu
* Created Date:   2013/7/8 16:27:24
* Description:    TS_Preview_Result的实体类
* Change History: 
* 
* */
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using WisDragon.Framework.EntityAttribute;

namespace TrainingsApp.Model {
    /// <summary>
    /// 表示TS_Preview_Result的类型
    /// </summary>
    [Serializable]
    public class TS_Preview_Result_Entity {
        /// <summary>
        /// 前概念主键
        /// </summary>
        [DataMapping("PreviewId", System.Data.DbType.Guid)]
        public System.Guid? PreviewId { get; set; }


        /// <summary>
        /// 批次ID
        /// </summary>
        [DataMapping("Batch", System.Data.DbType.Guid)]
        public System.Guid? Batch { get; set; }

        /// <summary>
        /// 用户表主键
        /// </summary>
        [DataMapping("UsreId", System.Data.DbType.Int64)]
        public System.Int64? UserId { get; set; }

        /// <summary>
        /// 问题主键
        /// </summary>
        [DataMapping("QuestionId", System.Data.DbType.Guid)]
        public System.Guid? QuestionId { get; set; }

        /// <summary>
        /// 回答答案
        /// </summary>
        [DataMapping("Result", System.Data.DbType.String)]
        public System.String Result { get; set; }

        /// <summary>
        /// 回答时间
        /// </summary>
        [DataMapping("AnswerDate", System.Data.DbType.DateTime)]
        public System.DateTime? AnswerDate { get; set; }

        /// <summary>
        /// 组类别
        /// </summary>
        [DataMapping("GroupId", System.Data.DbType.Int64)]
        public System.Int64? GroupId { get; set; }

        /// <summary>
        /// 分组时间
        /// </summary>
        [DataMapping("GroupDate", System.Data.DbType.DateTime)]
        public System.DateTime? GroupDate { get; set; }

        /// <summary>
        /// 组内排序字段
        /// </summary>
        [DataMapping("Sort", System.Data.DbType.Int32)]
        public System.Int32? Sort { get; set; }

        /// <summary>
        /// 组内回答总数
        /// </summary>
        [DataMapping("GroupCount", System.Data.DbType.Int32)]
        public System.Int32 GroupCount { get; set; }

        /// <summary>
        /// 回答总数
        /// </summary>
        [DataMapping("GroupTotal", System.Data.DbType.Int32)]
        public System.Int32 GroupTotal { get; set; }

        public System.Double ReferencePercent { get; set; }


        [DataMapping("RowNum", System.Data.DbType.Int32)]
        public System.Int32 RowNum { get; set; }


        /// <summary>
        /// 答题者姓名
        /// </summary>
        [DataMapping("Name", System.Data.DbType.String)]
        public System.String Name { get; set; }

        public char GroupName { get { return (char)(65 + GroupId); } }

        public System.Double ResultPercent { get; set; }

        public string ICO {
            get {
                if (GroupId == 99) {
                    return "small.gif";
                }
                else if (GroupId >= 0) {
                    if (Sort == 0) {
                        return "up.png";
                    }
                    else {
                        return "top.png";
                    }
                }
                else {
                    return "small.gif";
                }
            }
        }

        public string ICOTitle {
            get {
                if (GroupId == 99) {
                    return "分组";
                }
                else if (GroupId >= 0) {
                    if (Sort == 0) {
                        return "上移组";
                    }
                    else {
                        return "上移回答";
                    }
                }
                else {
                    return "分组";
                }
            }
        }

    }
}